//
//  Linearity.h
//  LinearityDemo
//
//  Created by 李禹 on 15/5/24.
//  Copyright (c) 2015年 dayu. All rights reserved.
//

#ifndef __LinearityDemo__Linearity__
#define __LinearityDemo__Linearity__

#include <stdio.h>
#include "MacroDefine.h"

#endif /* defined(__LinearityDemo__Linearity__) */

typedef struct {
    ElemType *elem;
    int length;
    int listsize;
}SqList;


void InitList(SqList &L);
void DestoryList(SqList &L);
void ClearList(SqList &L);
Status ListEmpty(SqList L);
int ListLength (SqList L);
Status GetElem(SqList L, int i, ElemType &e);
int LocateElem(SqList L, ElemType e, Status(* compare)(ElemType, ElemType));
Status PriorElem(SqList L, ElemType cur_e, ElemType &pre_e);
Status NextElem(SqList L, ElemType cur_e, ElemType &next_e);
Status ListInsert(SqList &L, int i, ElemType e);
Status ListDelete(SqList &L, int i, ElemType &e);
void ListTraverse(SqList L, void(* visit)(ElemType &));
